<!doctype html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>意见反馈</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/css.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/mui.min.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/mui.picker.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/mui.poppicker.css"/>
</head>

<body>
<style>
    [v-cloak] {
        display: none;
    }
</style>
<div v-cloak id="wrap" class="flex-wrap flex-vertical">
    <header>
        <ul>
            <li class="active">
                <i onclick="back()" class="icon iconfont icon-back"></i>
                <span>在线投诉</span>
                <em class="right" @click="goadviselist">进度列表</em>
            </li>
        </ul>
    </header>
    <div class="fixed-header">
        <div class="advise-cotents">
            <textarea class="advise-content" v-model="content" placeholder="请输入您的宝贵建议"></textarea>
        </div>
        <div class="login-form">
            <div class="sub-login" @click="getAbout">
                提交
            </div>
        </div>
    </div>
</div>
</body>

</html>
<script src="../../aui/js/aui.js"></script>
<script src="../../script/vue2.js"></script>
<script src="../../script/vue-resource.min.js"></script>
<script src="../../script/common.js"></script>
<script>
    var vm = new Vue({
        el: "#wrap",
        data: {
            content: ''
        },
        mounted: function () {
            var that = this;

            apiready = function () {
                // that.getAbout()
            };
        },
        methods: {
            goadviselist: function () {
                openWinto('advise_list', 'advise_list')
            },
            getAbout: function () {
                var that = this;
                if (that.content == '') {
                    api.toast({msg: '请输入意见内容', location: 'middle'});
                    return
                }
                showProgress();
                var token = $api.getStorage('userInfo').token
                api.ajax({
                    url: ajaxRoute.feekback,
                    method: 'post',
                    data: {
                        values: {
                            token: token,
                            content: that.content
                        }
                    }
                }, function (res, err) {
                    if (res.code == 1) {
                        api.hideProgress();
                        api.toast({msg: '提交成功', location: 'middle'});
                        that.content = ''
                    } else {
                        api.hideProgress();
                        api.toast({msg: res.msg, location: 'middle'});
                    }
                });
            }
        },
        filters: {
            getTel: function (value) {
                var phone = value
                return phone.substr(0, 3) + "****" + phone.substr(7)
            },
            getCard: function (value) {
                var phone = value
                return phone.substr(0, 5) + "********" + phone.substr(12)
            },
            getchecked: function (e) {
                var checked = ''
                if (e == 0) {
                    checked = '审核中'
                } else {
                    checked = '已审核'
                }
                return checked
            }
        }
    })
</script>
